import java.util.function.Function;

/**
 * @ClassName Demo13
 * @Description 练习：自定义函数模型拼接
 * @Author Li
 * @Date 2022/8/14 15:15
 * @ModifyDate 2022/8/14 15:15
 * @Version 1.0
 */
public class Demo13 {
    private static void method(String str, Function<String, String> fun1,
                               Function<String, Integer> fun2, Function<Integer, Integer> fun3) {
        Integer res = fun1.andThen(fun2.andThen(fun3)).apply(str);
        System.out.println(res);
    }

    public static void main(String[] args) {
        String str = "赵丽颖,20";
        method(str,
                s -> s.split(",")[1],
                s -> Integer.parseInt(s),
                i -> i + 10);
    }
}
